<!DOCTYPE html>
<html>

<head>
  <title>
    <%= title %>
  </title>
  <link rel='stylesheet' href='/stylesheets/style.css' />
  <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
  </script>
</head>

<body>
  <h1>
    <%=title %>
  </h1>
  <p>Welcome to <%=title %>
  </p>
  <br>
  <ul>
    <% for(let i=0;i<info.length;i++){ %>
      <li>
        <%=info[i].id %>——<%=info[i].name %>
      </li>
      <% } %>
  </ul>
  <h3>
    <%=user.sex %>
  </h3>
  <button id="btn">点击获取数据</button>
  <script>
    var btn = document.querySelector('#btn')
    btn.addEventListener('click', function () {
      $.ajax({
        url: "/cate",
        type: "get",
        success: res => {
          console.log(typeof res)
          console.log(JSON.parse(res))
        },
        fail: res => console.log(err)
      })
    })
  </script>
</body>

</html>